<?php
    namespace app\modules\exercise\models;
    use yii;
    use app\libs\Method;
    use yii\db\ActiveRecord;
    
    class ExerciseListDetail extends ActiveRecord {
        public static function tableName(){
            return '{{%exercise_list_detail}}';
        }

        // 此处用于练习 精听 和 中英文句子分割排序
        public static function getlabeldeletesetences($dats)
        {
            $da = array();
            $pregs = '/<p>[\s\S]*?<\/p>/';
            preg_match_all($pregs, $dats, $rel);
            foreach ($rel[0] as $v) {
                $pre = '/<p>([\s\S]*)<\/p>/';
                preg_match_all($pre, $v, $all);
                $da[] = str_replace('<!--|p-->','',$all[1][0]);
            }
            $da = array_filter($da);
            return $da;
        }

    }
